﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using static O.M.Production.Domain.EnumModel;

namespace O.M.Production.Domain.Entity
{
    /// <summary>
    /// 生产工单表
    /// </summary>
    [SugarTable("produce_work_order")]
    public class produce_work_order : BaseModel
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        [SugarColumn(ColumnDescription = "工单编号", IsPrimaryKey = true, Length = 100)]
        public string work_order_id { get; set; }


        /// <summary>
        /// 工单名称
        /// </summary> 
        [SugarColumn(ColumnDescription = "工单名称", Length = 100)]
        public string? work_order_name { get; set; }

        /// <summary>
        /// 生产单号
        /// </summary>
        [SugarColumn(ColumnDescription = "生产单号", Length = 100)]
        public string? internal_product_id { get; set; }

        /// <summary>
        /// 关联项目
        /// </summary>
        [SugarColumn(ColumnDescription = "关联项目", Length = 100)]
        public string? associated_project { get; set; }

        /// <summary>
        /// 进度
        /// </summary> 
        [SugarColumn(ColumnDescription = "进度", IsNullable = true)]
        public decimal rate_of_progress { get; set; }

        /// <summary>
        /// 工单日期
        /// </summary>
        [SugarColumn(ColumnDescription = "工单日期", IsNullable = true)]
        public DateTime? work_order_date { get; set; }

        /// <summary>
        /// 部门
        /// </summary> 
        [SugarColumn(ColumnDescription = "部门", Length = 100)]
        public string? department { get; set; }

        /// <summary>
        /// 负责人
        /// </summary> 
        [SugarColumn(ColumnDescription = "负责人", Length = 100)]
        public string? person_in_charge { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "负责人", Length = 100)]
        public string? remarks { get; set; }

        /// <summary>
        /// 工序数量
        /// </summary> 
        [SugarColumn(ColumnDescription = "工序数量")]
        public int process_quantity { get; set; }

        /// <summary>
        /// 预计产量
        /// </summary> 
        [SugarColumn(ColumnDescription = "预计产量")]
        public int designed_output { get; set; }

        /// <summary>
        /// 合格数量
        /// </summary> 
        [SugarColumn(ColumnDescription = "合格数量", IsNullable = true)]
        public int qualified_quantity { get; set; }

        /// <summary>
        /// 不良数量
        /// </summary> 
        [SugarColumn(ColumnDescription = "不良数量", IsNullable = true)]
        public int bad_quantity { get; set; }

        /// <summary>
        /// 合格率
        /// </summary> 
        [SugarColumn(ColumnDescription = "合格率", IsNullable = true)]
        public decimal? percent_of_pass { get; set; }

        /// <summary>
        /// 计划开始时间
        /// </summary> 
        [SugarColumn(ColumnDescription = "计划开始时间")]
        public DateTime? planned_start_time { get; set; }

        /// <summary>
        /// 计划结束时间
        /// </summary> 
        [SugarColumn(ColumnDescription = "计划结束时间")]
        public DateTime? planned_end_time { get; set; }

        /// <summary>
        /// 实际开始时间
        /// </summary> 
        [SugarColumn(ColumnDescription = "实际开始时间", IsNullable = true)]
        public DateTime? actual_start_time { get; set; }

        /// <summary>
        /// 实际结束时间
        /// </summary>
        [SugarColumn(ColumnDescription = "实际结束时间", IsNullable = true)]
        public DateTime? actual_end_time { get; set; }

        /// <summary>
        /// 生产产品
        /// </summary>
        [SugarColumn(ColumnDescription = "生产产品", Length = 100)]
        public string? production_product { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [SugarColumn(ColumnDescription = "产品编号", Length = 100)]
        public string? product_id { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        [SugarColumn(ColumnDescription = "规格型号", Length = 100)]
        public string? specifications_models { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        [SugarColumn(ColumnDescription = "单位", Length = 100)]
        public string? unit { get; set; }

        /// <summary>
        /// 报工次数
        /// </summary>
        [SugarColumn(ColumnDescription = "报工次数", Length = 100, DefaultValue = "0")]
        public int number_of_work_reports { get; set; } = 0;
        /// <summary>
        /// 附件
        /// </summary>
        [SugarColumn(ColumnDescription = "附件", Length = 200)]
        public string? attachment { get; set; }
    }
}
